package tutorial;

/**
 * Classe Action para Logon.
 * @author taciano
 */
public class Logon extends TutorialSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6142366099405030122L;

	public String execute() throws Exception {

		if (isInvalid(getUsername()))
			return INPUT;
		if (isInvalid(getPassword()))
			return INPUT;
		return SUCCESS;
	}

	private boolean isInvalid(String value) {
		return (value == null || value.length() == 0);
	}

	private String username;

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	private String password;

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

}